<?php
#============================
#	Filename: formlist.qgmod.php
#	Note	: 表单字段读取
#	Version : 2.0
#	Author  : ovsexia
#	Update  : 2018-06-08
#============================
global $FS,$DB,$prefix,$bi;

$md5 = md5(TemplateID."_".$sign);
$cache_file = "data/cache/formlist_".$md5.".php";#[缓存文件]
$check_status = false;
if($iscache)
{
	$check_status = CheckCache($cache_file);#[判断缓存文件的存储状态]
}
if($check_status)
{
	include_once($cache_file);
	unset($cache_file);
	return $formlist;
}

$form = $DB->qgGetOne("SELECT * FROM ".$prefix."form_cate WHERE sign='".$sign."'");
if($form)
{
	$formlist = $DB->qgGetAll("SELECT * FROM ".$prefix."form_field WHERE formid='".$form["id"]."' AND ifcheck=1 ORDER BY sortid ASC,id ASC");
	foreach($formlist AS $key=>$value)
	{
		$value["field_name"] = $value["field_name".$bi];
		$formlist[$key] = $value;
	}
}

$FS->qgWrite($formlist,$cache_file,"formlist");
return $formlist;
?>